var lod;
var Main = {
  data() {
    return {
      tableData:Array(
        
      ),
      default_menu: "1-1",
      currentPage: 1,
      fit: "cover",
      isCollapse: true,
      loading: true,
    }
  },
  mounted() {
    this.onEdit()
  },
  methods: {
    onPosts() {

    },
    onEdit() {
      lod = this.$loading({
        lock: true,
        text: '正在加载...',
        spinner: 'el-icon-loading',
        background: 'hsla(0,0%,100%,.9);'
      });
      const url = new URL(window.location.href);
      console.log(url.pathname);
      if (url.pathname == '/cls/dy') {
        this.default_menu = '1-1';
      } else if (url.pathname == '/cls/mate') {
        this.default_menu = '1-2';
      }
      this.currentPage = parseInt(url.searchParams.get("page"));
      for (var i = 0; i < $('div[class=post-item]').length; i++) {
        $("div[class=con-text-" + i + "]").css('height','24px');
        $("div[class=con-text-" + i + "] br").remove();
        $("div[class=con-text-" + i + "] p").css('margin', '0px');
        $("div[class=con-text-" + i + "] img").each(function () {
          var src = $(this).attr("src");
          var elimage = '<div class="el-image" style="width: 130px; height: 130px;margin-left:10px;"><img src="' + src + '" class="el-image__inner" style="object-fit: cover;"><!----></div>';
          $('.con-imgs-' + i).append(elimage);
          $(this).remove()
        });

      }
      lod.close();
    },
    handleSelect(key, keyPath) {
      switch (key) {
        case '1-1':
          var url = new URL('/cls/dy', window.location.href);
          window.location.href = url.href;

          break;
        case '1-2':
          var url = new URL('/cls/mate', window.location.href);
          window.location.href = url.href;

          break;
      }
    },
    handleCurrentChange(page) {
      location.href = '?page=' + page;
    }
  }
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')
// {$Request.baseUrl}